<template>
	<view class="addBtn u-color-theme" :style="{bottom:onReachBottom + 'rpx'}" @click="navigateTo">
		+
	</view>
</template>

<script>
	export default {
		name: "CustomAdd",
		props: {
			//跳转地址
			path: {
				type: String, 
				default: '',
			},
			//标题【新增或编辑】
			title: {
				type: String, 
				default: '',
			}
		},
		data(){
			return {			
				onReachBottom: 0, //元素距离屏幕底部绝对距离
			}
		},
		methods: {
			//跳转
			navigateTo() {
				uni.navigateTo({
					url: this.path
				})
			},
		},
		created() {
			this.onReachBottom = uni.getStorageSync("onReachBottom")
		}
	}
</script>

<style>
	.addBtn{
		position: fixed;
		/* left: 50%; */
		/* 配合【left: 50%;】实现居中 */
		/* transform: translateX(-50%); */
		right: 2%;
		width: 100rpx;
		height: 100rpx;
		border-radius: 100rpx;
		font-weight: bolder;
		color: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		background: #49BDFB;
		z-index: 99999;
	}
</style>